<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
    <title>
      Displaying the result of evaluating an expression
    </title>
  </head>
  <body>
    <h1>
      Displaying the Result of Evaluating an Expression
    </h1>
    <p>
      Displaying shows the result of evaluating an expression in the scrapbook editor.
    </p>
    <ol>
      <li>
        In the scrapbook page, either type an expression or highlight an existing expression to be displayed. For example: <code>System.getProperties();</code>
      </li>
      <li>
        Click the <strong>Display</strong> button in the toolbar (or select <strong>Display</strong> from the selection's pop-up menu.)
      </li>
      <li>
        The result of the evaluation appears highlighted in the scrapbook editor. The result displayed is either 
        <ul>
          <li>
            the value obtained by sending <code>toString()</code> to the result of the evaluation, or
          </li>
          <li>
            when evaluating a primitive data type (e.g., an <em>int</em> ), the result is the simple value of the result.
          </li>
        </ul>
      </li>
    </ol>
    <p>
      For example:
    </p>
    <ul>
      <li>
        Type and highlight <code>new java.util.Date()</code> in the editor, and click <strong>Display</strong>. A result such as <code>(java.util.Date) Tue Jun 12
        14:03:17 CDT 2001</code> appears in the editor.
      </li>
      <li>
        As another example, type and highlight <code>3 + 4</code> in the editor, and press <strong>Display</strong>. The result <code>(int) 7</code> is displayed in the
        editor.
      </li>
    </ul>
    <h3 class="related">Related Concepts</h3>
      <a href="../concepts/cscrapbook.htm">Scrapbook</a>
    <h3 class="related">Related Tasks</h3>
      <a href="../tasks/task-executing_an_expression.htm">Executing an expression</a><br>
      <a href="task-inspect_evaluation_result.htm">Inspecting the result of evaluating an expression</a><br>
      <a href="../tasks/task-view_runtime_exceptions.htm">Viewing runtime exceptions</a>
    <h3 class="related">Related References</h3>
      <a href="../reference/views/ref-view-scrapbook.htm">Java scrapbook page</a>
  </body>
</html>

